package com.cxyzy.tools.cq.test

object Test {
    @JvmStatic
    fun main(args: Array<String>) {
        val taskManager = TaskManager()
        taskManager.add(Task1(), 2)
        taskManager.add(Task2(), 3)
        var action = taskManager.next()
        while (action != null) {
            action.act()
            action = taskManager.next()
        }

    }
}

class Task1 : Task {
    override fun act() {
        println("Task1")
    }
}

class Task2 : Task {
    override fun act() {
        println("Task2")
    }
}